﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Senac.NetMob.Models;

namespace Lucas.Wendell.PI.Model
{
    [Table("Tb_Usuario")]
    public class Usuario : BaseModel
    {
        [Required]
        [StringLength(100, ErrorMessage = NetImobiliariaConstants.MESSAGE_ERROR_STRING_LENGTH)]
        public string Nome { get; set; }

        [Required]
        [StringLength(50, ErrorMessage = NetImobiliariaConstants.MESSAGE_ERROR_STRING_LENGTH + " - Mínimo de caracteres {1}", MinimumLength = 6)]
        public string Login { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [StringLength(50, ErrorMessage = NetImobiliariaConstants.MESSAGE_ERROR_STRING_LENGTH + " - Mínimo de caracteres {1}", MinimumLength = 6)]
        public string Senha { get; set; }

        [NotMapped]
        public string ConfirmaSenha { get; set; }

        public int PerfilId { get; set; }

        [ForeignKey("PerfilId")]
        public virtual Perfil Perfil { get; set; }
    }
}
